package com.ibeeking.found.common.enums.logistics;

public enum ExpressCalculateTypeEnum {

    CALCULATE_BY_NUM(" 按件数", 0),
    CALCULATE_BY_HEIGHT(" 按重量", 1),
    CALCULATE_BY_VOLUMN("按体积", 2),;
    private String desc;
    private Integer code;

    ExpressCalculateTypeEnum(String desc, int code) {
        this.code = code;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getCode() {
        return code;
    }

    public static String getDescByCode(Integer code) {
        for (ExpressCalculateTypeEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj.getDesc();
            }
        }
        return null;
    }
}
